//
//  SDNetworkErrorView.m
//  SKinDiary
//
//  Created by pcyang on 16/6/26.
//  Copyright © 2016年 tencent. All rights reserved.
//

#import "SDNetworkErrorView.h"

@interface SDNetworkErrorView()

@end

@implementation SDNetworkErrorView
-(id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self addTarget:self action:@selector(retryDown) forControlEvents:UIControlEventTouchUpInside];
        
        UIImage* image = LOAD_IMAGE_USE_CACHE_INBUNDLE(DefaultBundle, @"ic_blankpage_nowifi.png");
        
        [self setImage:image withTitle:@"网络不给力" withSubTitle:@"点击屏幕刷新"];
        [self setSubTitleImage:LOAD_IMAGE_USE_CACHE_INBUNDLE(DefaultBundle, @"ic_blankpage_nowifi_refresh.png")];
    }
    return self;
}


-(void)retryDown
{
    [SDNetworkErrorView hideBlankPageErrorFrom:self.containerView];
    if ([self.delegate respondsToSelector:@selector(networkErrorReload)]) {
        [self.delegate networkErrorReload];
    }
}
@end
